import fetch from 'common/src/utils/fetch'
import UTILS from "common/src/utils/utils";

/**
 * 报到统计查询列表
 * @param {*} data
 */
export function getNewStuRegisterSta(data) {
    return fetch({
        url: `/api/studentservice/uploadNewStudentPhoto/getNewStuRegisterSta?isOverseas=${data.isOverseas}&grade=${data.year}`,
        method: 'get'
    })
}
/**
 *报到统计导出
 */

export function exportNewStuRegisterSta(data) {
    return fetch({
        url: `/api/studentservice/uploadNewStudentPhoto/exportNewStuRegisterSta?isOverseas=${data.isOverseas}&grade=${data.year}`,
        method: 'get',
        data,
        responseType: 'blob'
    }).then(res => {
        UTILS.downloadFile(res, (data.isOverseas === '0' ? '中国生报到统计.xlsx' : '国际生报到统计.xlsx'), 'application/vnd.ms-excel;charset=utf-8');
    });
}
/**
 * 注册统计查询列表
 * @param {*} data
 */
export function getAllStuRegisterSta(data) {
    return fetch({
        url: `/api/studentservice/uploadNewStudentPhoto/getAllStuRegisterSta?isOverseas=${data.isOverseas}&calendarId=${data.calendarId}`,
        method: 'get'
    })
}
/**
 *注册统计导出
 */

export function exportAllStuRegisterSta(data) {
    return fetch({
        url: `/api/studentservice/uploadNewStudentPhoto/exportAllStuRegisterSta?isOverseas=${data.isOverseas}&calendarId=${data.calendarId}`,
        method: 'get',
        data,
        responseType: 'blob'
    }).then(res => {
        UTILS.downloadFile(res, (data.isOverseas === '0' ? '中国生注册统计.xlsx' : '国际生注册统计.xlsx'), 'application/vnd.ms-excel;charset=utf-8');
    });
}
